package com.tianyu.model.enums;

import lombok.Getter;

/**********************************
 * @Author YSW
 * @Description 接口返回枚举类型
 * @Date 2021/1/7 - 11:55
 **********************************/

@Getter
public enum RoState {
    TERMINAL_HAS_AUTH(201, "权限已获取"),
    SUCCESS(0, "操作成功"),
    FAIL(-200, "操作失败"),
    USER_LOGOUT_ERROR(-201, "异常退出登录"),
    NO_PERMISSIONS(-202, "无访问权限"),
    REQUEST_HEADERS_ERROR(-203, "请求头信息不完整"),
    PARAMS_MISS_ERROR(-204, "提交参数有问题, 请核实"),
    SMS_SEND_TOO_FAST(-205, "消息发送频率太快了"),
    API_PARAM_ERROR(-206, "接口参数错误"),
    USER_PHONE_NUMBER_BOUND(-207, "手机号已注册"),
    USER_PHONE_NUMBER_FORMAT_ERROR(-208, "手机号格式错误"),
    USER_ACCOUNT_EXIST_ERROR(-209, "账号已存在"),
    USER_ACCOUNT_FORMAT_ERROR(-210, "账号格式错误"),
    USER_NAME_FORMAT_ERROR(-211, "用户名格式错误,需2~10个中英文字符或数字"),
    USER_DISABLE_ERROR(-212, "账户被禁用,请联系管理员"),
    TERMINAL_REPEAT_ERROR(-213, "终端SN重复注册"),
    SYS_SERVER_ERROR(-500, "服务器内部错误, 无法完成请求"),

    WEBSOCKET_SUCCESS(100, "操作成功"),
    WEBSOCKET_FAIL(-100, "操作失败"),
    WEBSOCKET_REGISTER_PARAM_ERROR(-101, "缺少参数, WebSocket注册失败"),
    WEBSOCKET_REGISTER_TOKEN_ERROR(-102, "Token错误, WebSocket注册失败"),
    WEBSOCKET_REPEAT_REGISTRATION_ERROR(-103, "重复注册"),
    WEBSOCKET_HEARTBEAT_PARAM_ERROR(-104, "心跳包缺少参数"),
    WEBSOCKET_HEARTBEAT_OVERTIME(-105, "心跳超时, 关闭WebSocket连接"),
    WEBSOCKET_USER_DISABLE(-106, "用户被禁用,请联系管理员"),
    WEBSOCKET_USER_DELETE(-107, "用户被删除,请联系管理员"),
    WEBSOCKET_USER_LOGIN_OTHER_PLACE(-108, "异地登录");

    private final int value;
    private final String message;

    RoState(int value, String message) {
        this.value = value;
        this.message = message;
    }
}
